package com.mifengs.mall.services;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;

import com.mifengs.mall.util.MyCountDownTime;

public class CountTimeService extends Service {
    public static final String RETRIEVE_CODE_MESSGE = "retrieve_message";
    public static final String REGISTER_CODE_MESSAGE = "register_message";
    MyCountDownTime retrieveCountDown, registerCountDown;

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        String action = intent.getAction();
        if ("retrieveAction".equals(action)) {
            retrieveCountDown = new MyCountDownTime(60000, 1000, this, "retrieveAction");
            retrieveCountDown.start();
        } else if ("registerAction".equals(action)) {
            registerCountDown = new MyCountDownTime(60000, 1000, this, "registerAction");
            registerCountDown.start();
        }
        return flags;
    }
}
